package com.hc.ssm.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface BlogMapper {

	
	
	@Select("SELECT id,content,publishtime FROM blog where userid =#{id} LIMIT #{indexpage},#{pagesize}")
	List<Map<String, Object>> findBlog(Map<String, Object> map);

	@Insert("INSERT into blog ( content,publishtime,userid) VALUES(#{content},SYSDATE(),#{id})")
	int addBlog(Map<String, Object> map);

	
	@Delete("DELETE FROM blog WHERE id =#{id}")
	int deleteBlog(Map<String, Object> map);

	@Select("SELECT COUNT(id) count FROM blog where userid =#{id}")
	Map<String, Object> countBlog(Map<String, Object> map);
	
	

}
